home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
ehllsp16.zip
/
SP016.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-01-14
|
10KB
|
245 lines
/* SP016.CMD */
"echo off"
parse upper arg Base_Drive CMLIB_Drive Verified Samples .
if Base_Drive = "?" then signal syntax
start:
"cls"
say " "
say " ╔═════════════════════════════════════════════╗ "
say " ║ IBM OS/2 EHLLAPI Virtual Device Driver ║ "
say " ║ SelectPak 016 ║ "
say " ║ (prereq = ACS 6000) ║ "
say " ╚═════════════════════════════════════════════╝ "
say " "
say " "
say " "
/* get the Base Drive letter */
get_Base_Drive:
call charout ," Which drive is your base operating system on? (ie: C) "
if Base_Drive \= "" then signal got_Base_Drive
parse upper linein Base_Drive
got_Base_Drive:
if Base_Drive = "" then
do
say " You must enter a drive letter."
signal get_Base_Drive
end
"dir "Base_Drive":\OS2 > NUL 2>>&1"
if RC \= 0 then
do
say
say " "Base_Drive": does not have the \OS2 directory. "
say " You must enter the drive letter which has the \OS2 directory."
say " Press enter to continue. "
parse upper linein ignore
Base_Drive = ""
signal get_Base_Drive
end
LOG = ""Base_Drive":\OS2\INSTALL\SP016.LOG"
say
say " The SelectPak log will be written to "LOG"."
say " Your CONFIG.SYS will be backed up to CONFIG.OLD."
say " PCSHELL.DLL will be copied to "Base_Drive":\OS2\DLL\."
say
say
/* get the CMLIB Drive letter */
get_CMLIB_Drive:
call charout ," Which drive is your communications manager on? (ie: C) "
if CMLIB_Drive \= "" then signal got_CMLIB_Drive
parse upper linein CMLIB_Drive
got_CMLIB_Drive:
if CMLIB_Drive = "" then
do
say " You must enter a drive letter."
signal get_CMLIB_Drive
end
"dir "CMLIB_Drive":\CMLIB > NUL 2>>&1"
if RC \= 0 then
do
say
say " "CMLIB_Drive": Does not have the \CMLIB directory. "
say " You must enter the drive letter which contains the \CMLIB directory."
say " Press enter to continue. "
parse upper linein ignore
CMLIB_Drive = ""
signal get_CMLIB_Drive
end
say
say " Your VHAPI.OS2 will be renamed to VHAPI.OLD".
say " The new VHAPI.OS2 will be copied to "CMLIB_Drive":\CMLIB\VHAPI.OS2".
say
Samples:
say
say " You will require 230k on "Base_Drive" to install the sample programs."
call charout , " Do you want to install the sample programs? (Y/N) "
if Samples \= "" then signal got_Samples
parse upper linein Samples
got_Samples:
if Samples = "N" then signal no_Samples
if Samples \= "Y" then
do
say
say " Valid responses are Y and N"
Samples = ""
signal Samples
end
say
say " The DOS sample program will be copied to "Base_Drive":\DOSSAMPL\."
say " The Windows sample program will be copied to "Base_Drive":\WINSAMPL\."
say
signal verify
no_Samples:
say
say " The sample programs will not be installed."
say
verify:
say
call charout ," Are these parameters correct? (Y\N) "
if Verified \= "" then signal got_verify
parse upper linein Verified
got_verify:
if Verified = "N" then
do
Base_Drive = ""
CMLIB_Drive = ""
Samples = ""
Verified = ""
signal start
end
if Verified \= "Y" then
do
say
say " Valid responses are Y and N"
Verified = ""
signal verify
end
say
/* Check to see that the customer has WR06000 or WR06010 installed */
SYSLEVEL = ""CMLIB_Drive":\CMLIB\SYSLEVEL.ACS"
firstline = linein(SYSLEVEL)
RC = stream(SYSLEVEL,'c','close')
level = substr(firstline,45,7)
if level \= 'WR06010' & level \= 'WR06000' then
do
say
say " This SelectPak prereqs ACS 6000"
say " which is not installed ... Quitting"
say
signal End
end
"echo. >> "LOG
"echo ╔═════════════════════════════════════════════╗ >> "LOG
"echo ║ IBM OS/2 EHLLAPI Virtual Device Driver ║ >> "LOG
"echo ║ SelectPak 016 ║ >> "LOG
"echo ╚═════════════════════════════════════════════╝ >> "LOG
"echo. >> "LOG
"echo. >> "LOG
"echo. >> "LOG
say
PATH = ""CMLIB_Drive":\CMLIB"
"echo backing up "PATH"\SYSLEVEL.ACS >>"LOG" 2>>&1"
"copy "PATH"\SYSLEVEL.ACS SYSLVOLD.ACS >>"LOG" 2>>&1"
"echo backing up "PATH"\VHAPI.OS2 as "PATH"\VHAPI.OLD >>"LOG" 2>>&1"
"copy "PATH"\VHAPI.OS2 "PATH"\VHAPI.OLD >>"LOG" 2>>&1"
/* Unzip the files! */
"PKUNZIP2 -n SP016.ZIP PCSHLL.DLL "Base_Drive":\OS2\DLL\ >>"LOG" 2>>&1"
if RC = 0 then signal Zip_Done1
if RC = 11 then
do
say " "
say " "Base_Drive":\OS2\DLL\PCSHLL.DLL does not require an update. "
signal Zip_Done1
end
say " Errors occurred during the unpacking. When installation completes "
say " browse "LOG" to view the errors. "
say " "
say " Press enter to continue. "
parse upper linein ignore
Zip_Done1:
"PKUNZIP2 -n SP016.ZIP VHAPI.OS2 "CMLIB_Drive":\CMLIB >>"LOG" 2>>&1"
if RC = 0 then signal Zip_Done2
if RC = 11 then
do
say " "
say " "PATH"\VHAPI.DLL does not require an update. "
signal Zip_Done2
end
say " Errors occurred during the unpacking. When installation completes "
say " browse "LOG" to view the errors. "
say " "
say " Press enter to continue. "
parse upper linein ignore
Zip_Done2:
"PKUNZIP2 -n SP016.ZIP SYSLEVEL.ACS "CMLIB_Drive":\CMLIB >>"LOG" 2>>&1"
if RC = 0 then signal Zip_Done3
if RC = 11 then
do
say " "
say " "PATH"\SYSLEVEL.ACS does not require an update. "
signal Zip_Done3
end
say " Errors occurred during the unpacking. When installation completes "
say " browse "LOG" to view the errors. "
say " "
say " Press enter to continue. "
parse upper linein ignore
Zip_Done3:
if Samples = "N" then signal skip_Samples
"PKUNZIP2 -n -d SP016.ZIP SAMPLES\*.* "Base_Drive":\ >>"LOG" 2>>&1"
if RC = 0 then signal Zip_Done4
if RC = 11 then
do
say " "
say " No Samples found in "Base_Drive":\ requiring updates "
signal Zip_Done4
end
say " Errors occurred during the unpacking. When installation completes "
say " browse "LOG" to view the errors. "
say " "
say " Press enter to continue. "
parse upper linein ignore
Zip_Done4:
say " "
say " ╔═════════════════════════════════════════════╗ "
say " ║ SP016 SelectPak Installation Complete. ║ "
say " ╚═════════════════════════════════════════════╝ "
say " "
signal End
/* Help panel */
syntax:
say " "
say " You need only enter: SP016 "
say " "
say " You will then be prompted for: "
say " 1) The Drive with your Base Operation System. "
say " Enter the Drive letter which contains \OS2. "
say " 2) The Drive with your Communications Manager. "
say " Enter the Drive letter which contains \CMLIB. "
say " 3) Do you wish to install the Sample Programs? "
say " Enter Y or N. (230k required) "
say " 4) Are the above parameters correct? "
say " Enter Y or N. "
say " "
say " "
say " You may stack the responses with the call to SP016 if you wish. "
say " ie: SP016 C C Y Y "
say " "
say " "
End: